package com.jinghua.treatment.controller;

import com.jinghua.treatment.entity.SysGynaecology;
import com.jinghua.treatment.service.SysGynaecologyService;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 妇科情况控制器
 * Created by 王兴光 on 2018/3/26.
 */
@Controller
@RequestMapping("/Gynaecology")
public class SysGynaecologyController {

    @Resource
    private SysGynaecologyService gynaecologyService;

    @ApiOperation(value="根据妇科情况编号查询妇科情况信息")
    @GetMapping(value="/getGynaecologyById",params = {"gynaecologyId"})
    @ResponseBody
    public SysGynaecology findGynaecologyById(Integer gynaecologyId){return gynaecologyService.selectByPrimaryKey(gynaecologyId);};

    @ApiOperation(value="新增妇科情况信息")
    @GetMapping(value="/insertGynaecology")
    @ResponseBody
    public int insertGynaecology(SysGynaecology gynaecology){return gynaecologyService.insert(gynaecology);};

    @ApiOperation(value="更新妇科情况信息")
    @GetMapping(value="/updateGynaecology")
    @ResponseBody
    public int updateGynaecology(SysGynaecology gynaecology){return gynaecologyService.updateByPrimaryKey(gynaecology);};
}
